
<template>
  <div class="home">
    <!-- <Edit ref="edit">
      <el-button class="submit-btn" type="primary" @click="handleSub">保 存</el-button>
    </Edit> -->
  </div>
</template>

<script>
// import Edit from "@/components/Edit"
const initJSON = {"version":"5.3.0","objects":[{"type":"rect","version":"5.3.0","originX":"left","originY":"top","left":0,"top":0,"width":3750,"height":1750,"fill":"#ffffff","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeUniform":false,"strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","skewX":0,"skewY":0,"rx":0,"ry":0,"id":"workspace","selectable":false,"hasControls":false},{"type":"triangle","version":"5.3.0","originX":"left","originY":"top","left":452,"top":174.07,"width":400,"height":400,"fill":"#92706B","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeUniform":false,"strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":"","visible":true,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","skewX":0,"skewY":0,"id":"12f3fd1f-d917-4aab-9a87-7da48c9725e7","selectable":true,"hasControls":true},{"type":"polygon","version":"5.3.0","originX":"left","originY":"top","left":1329.42,"top":235.45,"width":400,"height":400,"fill":"#ccc","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeUniform":false,"strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":"","visible":true,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","skewX":0,"skewY":0,"id":"bed09842-9cae-489e-b9e4-ea265891d546","selectable":true,"hasControls":true,"points":[{"x":1.2246467991473532e-14,"y":-200},{"x":190.2113032590307,"y":-61.803398874989476},{"x":117.55705045849463,"y":161.80339887498948},{"x":-117.5570504584946,"y":161.80339887498948},{"x":-190.21130325903073,"y":-61.803398874989455}]}],"clipPath":{"type":"rect","version":"5.3.0","originX":"left","originY":"top","left":0,"top":0,"width":3750,"height":1750,"fill":"#ffffff","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeUniform":false,"strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","skewX":0,"skewY":0,"rx":0,"ry":0,"selectable":true,"hasControls":true},"background":"#F1F1F1"}

export default {
  // components: { Edit },
  provide() {
    return {
      getModules: () => []
    }
  },
  data() {
    return {
      // 车位
      moduleList: [], // 列表可拖动模块
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    async init() {
      try {
        // const res = await getParkInfo({ id: this.$route.query.id })
        // this.row = res.data
        // this.moduleList = this.row.parkList.map(item => {
        //   return {
        //     ...item,
        //     logo: 'park',
        //     type: 'initial'
        //   }
        // })

        this.$nextTick(() => {
          this.$refs.edit.importJson(initJSON)
        })
      } catch (e) {
        console.error(e);
      }
    },
    handleSub() {
      const parkJson = JSON.stringify(this.$refs.edit.exportJson())
      console.log(111, parkJson)
    },
  },
}
</script>
<style lang="scss" scoped>
.home {
  width: 100%;
  height: 100%;
  display: flex;
  // padding: 20px;
  box-sizing: border-box;
  background: #1c3651;
  color: #ccc;

  .submit-btn {
    width: 100%;
    // height: 32px;
  }

}
</style>
